const app = getApp();

Component({
  properties: {
    params: {
      type: Object,
      value: {}
    }
  },
  data: {
    header: app.global.headerHeight
  },
  ready() {
    const {
      padding_top_bottom,
      padding_left_right,
      background,
      style,
      sticky,
      text,
      keyword
    } = this.properties.params

    this.setData({
      padding_top_bottom: padding_top_bottom,
      padding_left_right: padding_left_right,
      background: background,
      style: style,
      sticky: sticky,
      text: text,
      keyword: keyword
    });
  },
  methods: {
    search() {
      wx.navigateTo({
        url: '/pages/search/index',
      })
    },

    redirect(event) {
      if (event.currentTarget.dataset.link) {
        app.redirect(event.currentTarget.dataset.link);
      }
    },

    search(event) {
      app.redirect('/pages/goods/index/index?keyword=' + event.currentTarget.dataset.keywork);
    }
  }
})